<?php
//客户留言管理控制器
	namespace Application\Admin\Controller;
	use Application\Admin\Controller\Admin;
	use Application\Admin\Model\Message as Messagemodel;
	class Message extends Admin{
		public function index(){			
			$Messagemodel = new Messagemodel();
			$this->message = $Messagemodel -> order('id asc') -> select();
			$this->render();
		}
		
		public function delete(){
			if(IS_GET){
				$id = $_GET['id'];
				$messageModel = new MessageModel();
				$message = $messageModel -> findModel($id);
				if($message -> delete()){
					echo "<script>alert('删除成功');window.location.href='index.php?m=admin&c=message&a=index';</script>";
				}
			}
		}		
		
	}
?>